package org.fing.edu.uy.esbadp.assertion;

import org.jboss.soa.esb.message.Message;

public class AssertProperty {

	/**
     * Assert that the property exist.
     * @param arg Message.
     * @param argName Property name.
     * @throws IllegalArgumentException Argument is null.
     */
    public static Object isNotNull(Message arg, String argName) throws IllegalArgumentException {
        if (arg.getProperties().getProperty(argName) == null) {
            throw new IllegalArgumentException("null '" + argName + "' property in method call.");
        }
        return arg;
    }
	
}
